package com.gxuwz.service.impl;

import com.gxuwz.entity.Material;
import com.gxuwz.mapper.MaterialMapper;
import com.gxuwz.service.IMaterialService;
import com.gxuwz.util.DateUtils;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 刘玉霜
 * @since 2017-10-27
 */
@Service
public class MaterialServiceImpl extends ServiceImpl<MaterialMapper, Material> implements IMaterialService {

	@Autowired
	private MaterialMapper materialDao;

	@Override
	public Integer save(Material material) {
		// 设置未采购
		material.setIsPurchase(-1);
		material.setCreateTime(DateUtils.getNowDefaultFormat());
		return materialDao.insert(material);
	}
	
	
	
}
